package com.yuexiao.service;

import com.yuexiao.entity.DishDto;
import com.yuexiao.pojo.Dish;
import com.yuexiao.pojo.ShoppingCart;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author Administrator
* @description 针对表【shopping_cart(购物车)】的数据库操作Service
* @createDate 2022-08-10 14:10:57
*/
public interface ShoppingCartService extends IService<ShoppingCart> {

    /**
     * 根据用户id查询购物车列表
     * @param userid Long 用户id
     * @return List<ShoppingCart> 购物车列表
     */
    List<ShoppingCart> getShoppingCartListByUserId(Long userid);


    /**
     * 新增购物车记录
     * @param shoppingCart ShoppingCart 购物车数据对象
     * @return ShoppingCart 新增数据对象
     */
    ShoppingCart insertShopping(ShoppingCart shoppingCart);


    /**
     * 根据套餐id或者菜品id更改商品数量
     * @param shoppingCart ShoppingCart 购物车数据对象
     * @return ShoppingCart 购物车数据对象
     */
    ShoppingCart updateShoppingCartByDishIdOrSetmealId(ShoppingCart shoppingCart);


    /**
     * 根据用户id删除购物车数据
     * @param id Long 用户id
     * @return boolean true or false
     */
    boolean deleteShoppingCartByUserId(Long id);

}
